package sfbot;

import java.util.Calendar;

public class LogLine{
	private String msg;
	private User user;
	private Channel channel;
	private Calendar time;
	public LogLine(String msg, User user, Channel channel){
		this(msg, user, channel, Calendar.getInstance());
	}
	
	public LogLine(String msg, User user, Channel channel, Calendar timeStamp){
		this.msg = msg;
		this.user = user;
		this.channel = channel;
		this.time = timeStamp;
	}
	
	public Calendar getTimeStamp(){
		return time;
	}
	
	public int compareTo(LogLine l){
		return time.compareTo(l.time);
	}
	
	public String toString(){
		return String.format("[%1$tH:%1$tM:%1$tS:%1$tL] %2$-15s: %3$s", time, user.getNick(), msg);
	}

	public String getNick() {
		return user.getNick();
	}
	
	public String getChannelName(){
		return channel.getName();
	}

	public String getMessage() {
		// TODO Auto-generated method stub
		return msg;
	}
}